<?php 
/**
 * Entry Point per la parte di amministrazione
 */
require_once $_SERVER['DOCUMENT_ROOT']."/config_dbentity.php";
require_once $_SERVER['DOCUMENT_ROOT']."/includes/framework.php";

define("_ENTRY_", 1);

import("includes.session");
import("includes.debug"); // only if required

session_start();

$db = get_session_db($db_config);

if(!user_is_logged($db))
{
	header("Location:login.php?from=admin.php");
	//echo "Sessione non loggata";
	exit();
}

$db = get_session_db();

//echo "UID: {$_SESSION['uid']} (admin.php)<br />";
if(!user_is_logged($db))
{
	header("Location:login.php?from=admin.php");
	//echo "Sessione non loggata";
	exit();
}

$user = get_session_user();

// variabili da utilizzare per la visualizzazione delle info di login
$username = $user->getUsername();
$is_admin = $user->isAdmin();

?>